package com.wxtwxt.ruralmall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author Wxt
 * @create 2023-04-20 21:58
 */
@Data
public class UserRegisterVo {
    @NotNull(message = "用户名必须填写")
    @Length(min = 6, max = 18, message = "用户名必须是6-18位字符")
    private String userName;
    @NotNull(message = "密码必须填写")
    @Length(min = 6, max = 18, message = "密码必须是6-18位字符")
    private String password;
    @NotNull(message = "邮箱必须填写")
    @Pattern(regexp = "^[a-z\\d]+(\\.[a-z\\d]+)*@([\\da-z](-[\\da-z])?)+(\\.{1,2}[a-z]+)+$", message = "邮箱格式不正确")
    private String email;
    @NotEmpty(message = "验证码不能为空")
    private String code;
}
